package com.example.dingtalklogin.manager.dingtalk;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 钉钉老版api oapi的client声明
 * token拦截器自动传入
 * @author xuzhen97
 */
@FeignClient(
        name = "dingtalkOpapiClient",
        url = "https://oapi.dingtalk.com",
        configuration = DingtalkOApiConfig.class
)
@Component
public interface DingtalkOApiClient {
    /**
     * 通过用户免登码获取用户信息
     * @return
     */
    @PostMapping("/topapi/v2/user/getuserinfo")
    OApiResponse<ExemptUserInfo> getExemptUserInfo(@RequestBody ExemptUserInfoRequest request);

}
